<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
if(empty($_GET['cid']) || !is_numeric($_GET['cid'])){
	$cates = C::t('home_videocate')->get_all_cate();
	foreach ($cates as $key => $value) {
		$videos = C::t('home_video')->get_all_video($value['cate_id'], 0, 5);
		$cates[$key]['videos'] = $videos;
		$cates[$key]['nums'] = count($videos);
	}
	include template('diy:video/index:');
}else{
	$cate = C::t('home_videocate')->get_cate_by_id($_GET['cid']);
	$cate['videos'] = C::t('home_video')->get_all_video_by_id($cate['cate_id']);
	include template('diy:video/cate:');
}



?>